﻿
using System;
using System.Collections.Generic;

namespace LxCFD
{
    public class SolvableUnitGroup<T> : UnitGroupBase<T>, ISolvableUnit where T : ISolvableUnit, new()
    {
        public SolverTypes SolverType { get; set; } = SolverTypes.AMGV;

        public void Solve_Steady()
        {
            foreach (var u in Units)
            {
                u.Solve_Steady();
            }
        }

        public void Solve_ExplicitTransient()
        {
            foreach (var u in Units)
            {
                u.Solve_ExplicitTransient();
            }
        }

        public void SaveOldValue()
        {
            foreach (var u in Units)
            {
                u.SaveOldValue();
            }
        }

        public void Solve_ImplicitTransient()
        {
            foreach (var u in Units)
            {
                u.Solve_ImplicitTransient();
            }
        }
    }
}
//public override void Rearrange(ConnectivityAnalysisTool connectivityAnalysis)
//{
//    Units = TempStor.SplitByConnectivity(connectivityAnalysis);
//    foreach (var u in Units)
//    {
//        u.InitializeLineSolver(solverType);
//    }
//    TempStor = null;
//}